<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>devcfg: xdevcfg_reg_readback_example.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.gif"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">devcfg
   </div>
   <div id="projectbrief">Xilinx SDK Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xdevcfg__reg__readback__example_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">xdevcfg_reg_readback_example.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>This file contains a design example using the DevCfg driver and hardware device. </p>
<p>This example prints out the values of all the configuration registers in the FPGA.</p>
<p>This example assumes that there is a UART Device or STDIO Device in the hardware system.</p>
<dl class="section note"><dt>Note</dt><dd>None.</dd></dl>
<p>MODIFICATION HISTORY:</p>
<pre>
  Ver   Who  Date     Changes
<hr/>

  3.1   sb  08/25/14  First Release
*</pre> </div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr><td colspan="2"><div class="groupHeader">Configuration Type1 packet headers masks</div></td></tr>
<tr class="memitem:a3d76429575a75809a84bbaeb6a5c4226"><td class="memItemLeft" align="right" valign="top"><a id="a3d76429575a75809a84bbaeb6a5c4226"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>XDC_TYPE_SHIFT</b>&#160;&#160;&#160;29</td></tr>
<tr class="separator:a3d76429575a75809a84bbaeb6a5c4226"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad8503a9a00359af9a6bf181bba704672"><td class="memItemLeft" align="right" valign="top"><a id="ad8503a9a00359af9a6bf181bba704672"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>XDC_REGISTER_SHIFT</b>&#160;&#160;&#160;13</td></tr>
<tr class="separator:ad8503a9a00359af9a6bf181bba704672"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af7caa0b213b5fe6621b8cd81cd4ac3e4"><td class="memItemLeft" align="right" valign="top"><a id="af7caa0b213b5fe6621b8cd81cd4ac3e4"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>XDC_OP_SHIFT</b>&#160;&#160;&#160;27</td></tr>
<tr class="separator:af7caa0b213b5fe6621b8cd81cd4ac3e4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ada287d3c07c1fef38e9486c6b9526bbd"><td class="memItemLeft" align="right" valign="top"><a id="ada287d3c07c1fef38e9486c6b9526bbd"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>XDC_TYPE_1</b>&#160;&#160;&#160;1</td></tr>
<tr class="separator:ada287d3c07c1fef38e9486c6b9526bbd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a53a39a0edaa5fc54b0cf28e4965ada63"><td class="memItemLeft" align="right" valign="top"><a id="a53a39a0edaa5fc54b0cf28e4965ada63"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>OPCODE_READ</b>&#160;&#160;&#160;1</td></tr>
<tr class="separator:a53a39a0edaa5fc54b0cf28e4965ada63"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ae521229b81ef92bbf76223679d5ae55e"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xdevcfg__reg__readback__example_8c.html#ae521229b81ef92bbf76223679d5ae55e">XDcfgRegReadExample</a> (u16 DeviceId)</td></tr>
<tr class="memdesc:ae521229b81ef92bbf76223679d5ae55e"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function reads the configuration registers inside the FPGA.  <a href="#ae521229b81ef92bbf76223679d5ae55e">More...</a><br /></td></tr>
<tr class="separator:ae521229b81ef92bbf76223679d5ae55e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af9cf92cccf467028f2ac04b532a100c0"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xdevcfg__reg__readback__example_8c.html#af9cf92cccf467028f2ac04b532a100c0">XDcfg_GetConfigReg</a> (<a class="el" href="struct_x_dcfg.html">XDcfg</a> *DcfgInstancePtr, u32 ConfigReg, u32 *RegData)</td></tr>
<tr class="memdesc:af9cf92cccf467028f2ac04b532a100c0"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function returns the value of the specified configuration register.  <a href="#af9cf92cccf467028f2ac04b532a100c0">More...</a><br /></td></tr>
<tr class="separator:af9cf92cccf467028f2ac04b532a100c0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae3c70039dd766655785f65896710cf75"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xdevcfg__reg__readback__example_8c.html#ae3c70039dd766655785f65896710cf75">XDcfg_RegAddr</a> (u8 Register, u8 OpCode, u8 Size)</td></tr>
<tr class="memdesc:ae3c70039dd766655785f65896710cf75"><td class="mdescLeft">&#160;</td><td class="mdescRight">Generates a Type 1 packet header that reads back the requested Configuration register.  <a href="#ae3c70039dd766655785f65896710cf75">More...</a><br /></td></tr>
<tr class="separator:ae3c70039dd766655785f65896710cf75"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xdevcfg__reg__readback__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
<tr class="memdesc:a840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Main function to call the DevCfg Reg Read example.  <a href="#a840291bc02cba5474a4cb46a9b9566fe">More...</a><br /></td></tr>
<tr class="separator:a840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="a840291bc02cba5474a4cb46a9b9566fe"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a840291bc02cba5474a4cb46a9b9566fe">&#9670;&nbsp;</a></span>main()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int main </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Main function to call the DevCfg Reg Read example. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">None.</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if successful</li>
<li>XST_FAILURE if unsuccessful</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="xdevcfg__reg__readback__example_8c.html#ae521229b81ef92bbf76223679d5ae55e">XDcfgRegReadExample()</a>.</p>

</div>
</div>
<a id="af9cf92cccf467028f2ac04b532a100c0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af9cf92cccf467028f2ac04b532a100c0">&#9670;&nbsp;</a></span>XDcfg_GetConfigReg()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XDcfg_GetConfigReg </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_dcfg.html">XDcfg</a> *&#160;</td>
          <td class="paramname"><em>DcfgInstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>ConfigReg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32 *&#160;</td>
          <td class="paramname"><em>RegData</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function returns the value of the specified configuration register. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the XHwIcap instance. </td></tr>
    <tr><td class="paramname">ConfigReg</td><td>is a constant which represents the configuration register value to be returned. </td></tr>
    <tr><td class="paramname">RegData</td><td>is the value of the specified configuration register.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if successful</li>
<li>XST_FAILURE if unsuccessful</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="struct_x_dcfg___config.html#a97b0e40ed1632649e15eedea77e84a82">XDcfg_Config::BaseAddr</a>, <a class="el" href="struct_x_dcfg.html#aa781f458f64d74c8147d10f09683301e">XDcfg::Config</a>, <a class="el" href="group__devcfg__v3__3.html#gafff047d176ced3a255248219c1278e3b">XDcfg_IntrClear()</a>, <a class="el" href="group__devcfg__v3__3.html#gae46a37df60109876c5f96d62dc6b9f78">XDCFG_IXR_D_P_DONE_MASK</a>, <a class="el" href="group__devcfg__v3__3.html#ga219beab8ecbdaa4e74c8d130b94e4ae0">XDCFG_IXR_DMA_DONE_MASK</a>, <a class="el" href="group__devcfg__v3__3.html#ga39c7e70832ef5a30a251342bf831f088">XDCFG_IXR_PCFG_DONE_MASK</a>, <a class="el" href="group__devcfg__v3__3.html#ga77561dc2e9ea13137f50a8193b8fbcd3">XDcfg_ReadReg</a>, <a class="el" href="xdevcfg__reg__readback__example_8c.html#ae3c70039dd766655785f65896710cf75">XDcfg_RegAddr()</a>, <a class="el" href="group__devcfg__v3__3.html#ga48a0c155d061c98656101cb19a87f0a0">XDCFG_STATUS_DMA_CMD_Q_F_MASK</a>, and <a class="el" href="group__devcfg__v3__3.html#ga6646b7874a5c9cc7bcdba6072bb4ff72">XDCFG_STATUS_OFFSET</a>.</p>

<p class="reference">Referenced by <a class="el" href="xdevcfg__reg__readback__example_8c.html#ae521229b81ef92bbf76223679d5ae55e">XDcfgRegReadExample()</a>.</p>

</div>
</div>
<a id="ae3c70039dd766655785f65896710cf75"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae3c70039dd766655785f65896710cf75">&#9670;&nbsp;</a></span>XDcfg_RegAddr()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 XDcfg_RegAddr </td>
          <td>(</td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>Register</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>OpCode</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>Size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Generates a Type 1 packet header that reads back the requested Configuration register. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">Register</td><td>is the address of the register to be read back. </td></tr>
    <tr><td class="paramname">OpCode</td><td>is the read/write operation code. </td></tr>
    <tr><td class="paramname">Size</td><td>is the size of the word to be read.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Type 1 packet header to read the specified register</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">Referenced by <a class="el" href="xdevcfg__reg__readback__example_8c.html#af9cf92cccf467028f2ac04b532a100c0">XDcfg_GetConfigReg()</a>.</p>

</div>
</div>
<a id="ae521229b81ef92bbf76223679d5ae55e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae521229b81ef92bbf76223679d5ae55e">&#9670;&nbsp;</a></span>XDcfgRegReadExample()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XDcfgRegReadExample </td>
          <td>(</td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>DeviceId</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function reads the configuration registers inside the FPGA. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">DeviceId</td><td>is the unique device id of the device.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if successful</li>
<li>XST_FAILURE if unsuccessful</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="struct_x_dcfg___config.html#a97b0e40ed1632649e15eedea77e84a82">XDcfg_Config::BaseAddr</a>, <a class="el" href="group__devcfg__v3__3.html#gafcaaa8ac67cf7316c54d1cba36e83e08">XDcfg_CfgInitialize()</a>, <a class="el" href="xdevcfg__reg__readback__example_8c.html#af9cf92cccf467028f2ac04b532a100c0">XDcfg_GetConfigReg()</a>, <a class="el" href="group__devcfg__v3__3.html#gab7512afadad93e25630048943fd72d41">XDcfg_LookupConfig()</a>, and <a class="el" href="group__devcfg__v3__3.html#ga2c24756b9d6f8e81b620d27a86379e15">XDcfg_SelfTest()</a>.</p>

<p class="reference">Referenced by <a class="el" href="xdevcfg__reg__readback__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Copyright &copy; 2015 Xilinx Inc. All rights reserved.</li>
  </ul>
</div>
</body>
</html>
